package com.pet.server.bo.common;

import java.io.Serializable;
import java.util.List;

import com.pet.server.dao.common.CommonDao;



public class CommonService {
    private CommonDao commonDao;
	public CommonDao getCommonDao() {
		return commonDao;
	}
	public void setCommonDao(CommonDao commonDao) {
		this.commonDao = commonDao;
	}
	public void saveObject(Object obj){
		commonDao.saveObject(obj);
	}
	
	public int creatObject(Object obj){
		int id = commonDao.creatObject(obj);
		return id;
		
	}
	
	public void saveOrUpdateObject(Object obj){
		commonDao.saveObject(obj);
	}
	public void updateObject(Object obj){
		commonDao.updateObject(obj);
	}
	public void mergeObject(Object obj){
		commonDao.mergeObjects(obj);
	}
	public <T> T getObject(Serializable id, Class<T> toType) {
		return commonDao.get(id, toType);
	}
	public <T> T loadObject(Serializable id, Class<T> toType) {
		return commonDao.load(id, toType);
	}
	public void deleteObject(Object obj){
		commonDao.deleteObject(obj);
	}
	public void deleteObject(Serializable id, Class clazz){
		commonDao.deleteObject(clazz, id);
	}
	public void savebatchObject(List list){
		commonDao.saveObjects(list);
	}
}
